from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^login/$', views.LoginView.as_view(), name='login'),
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.CheckUsernameView.as_view()),
    url(r'^mobiles/(1[345789]\d{9})/count/$', views.CheckPhoneView.as_view()),
    url(r'^info/$', views.UserCenterInfoView.as_view(), name='user_center'),
    url(r'^emails/$', views.EmailView.as_view(), name='email'),
    url(r'^emails/verification/$', views.EmailActiveView.as_view(), name='email'),
    url(r'^addresses/$', views.AddressesView.as_view()),
    url(r'^addresses/create/$', views.AddressesCreateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/$', views.AddressesUpdateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.AddressesDefaultView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.AddressesTitleView.as_view()),
    url(r'^password/$', views.PasswordChangeView.as_view()),
    url(r'^find_password/$', views.FindPasswordView.as_view()),
    url(r'^users/(?P<user_id>\d+)/password/$', views.SetNewPasswordView.as_view()),
]